#ifndef CURRENTEDITOR_H
#define CURRENTEDITOR_H
#include "Include/Plugins.h"
#include "Include/IEditor.h"

class QAbstractTableModel;
class CurrentEditor: public QObject
{
    Q_OBJECT
public:
    CurrentEditor(QObject* parent = NULL);
    virtual ~CurrentEditor();
    void setEditor(PluginWrapper<Plugins::IEditor> & ed);
    PluginWrapper<Plugins::IEditor> editor();
    QString selectedText();

    void find(const QString& find, bool forward);
    void replace(const QString& find, const QString& replace, bool findNext, bool forward);
    void replaceAll(const QString& find, const QString& replace);
signals:
    void undoAvailable(bool);
    void redoAvailable(bool);
    void copyAvailable(bool);
    void pasteAvailable(bool);
    void findAvailable(bool);
    void modifyChanged(bool);
    void errorListChanged(QAbstractTableModel*);
    void fileNavigate(const QString&, int);
public slots:
    void undo();
    void redo();
    void copy();
    void cut();
    void paste();
    void del();
    void selectAll();
    void setFocus();

    void uppercase();
    void lowercase();
    void capitalize();
    void save();
    bool reset();
    void jumpLine(int);
    void jumpOffset(int);
protected slots:
    void testSlot(bool);
private:
    PluginWrapper<Plugins::IEditor> _ed;
};

#endif // CURRENTEDITOR_H
